home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
ab20
/
unarced
/
datacomm
/
ncomm
/
host
/
host.script
< prev
next >
Wrap
Text File
|
1995-03-17
|
39KB
|
1,149 lines
;*******************************************************
; NComm HOST SYSTEM
; Version se below
;
; Copyright © 1989 Daniel Bloch ( ->Ver 1.3)
; Copyright © 1990 Nils-Arne Dahlberg
; FREEWARE!!!!
;*******************************************************
; revision history
; by 1.6 these things are added:
; Search for menus, bulletins and messages in separate directories
; Private messages for all users
; 1.7
; Private user passwords
; 1.8
; Double menus
; 1.9
; More messages areas
; 1.91
; Packing and download of messages
; 1.92
; UL/DL check
; 1.93
; Remote Backup
; Cosysop enabeld
; 1.94
; Using extended hayes setup (all reset z0 gives right setup)
; 1.95
; Removed part of page routine..
; 1.96
; Changes in file menu
; 1.97
; Changes in messages menus
; Local mode
; 1.98
; Cleanup, changing sysop/cosysop versions
; 1.99
; Change of dos-commands in SYsop menu
; change of sysop password placement
; 2.00
; Changed placement of U/D load credits
; 2.01
; Fixed a bug in placement of $name"DL" files
; Added Possibility to grab bulletins
; Added "waiting " at up/download
; 2.02
; Changed packing program to variable, use what you want as sysop
; 'Return' leaves password change.
; 2.03
; Just a bugfix
; 2.04
; Changed timout command to make a 300 s timeout for logon as well
; 2.05
; Made a small change to shorten the file
; 2.06
; Added features: filetransfer with Ymodem-Batch and Ymodem-G
; Print version number from main menu
; 2.07
; A special reboot, or break facility included, I might take this
; into an later E-script
; 2.08
; Changed for an error when HOLD-directory is missing, this
; directory might be missing due to the fact that BU-progs not
; allways copies empty directories
; 2.09
; Changed password routine to not accept nil password
; 2.10
; YABH (Yet Another Bug-Hunt...)
; Missed two \" in delete comment part...
; Added Start Script in Sysop mode....
; removed a IF $ -line, line no 680 somewhere....
; 2.10E
; Back in english, again...
; 2.11E
; Some small special features
; A user questionare is added, upload for just some users,
; a bug in login-sequense is corrected.
; The messages editing is made in ram: now
SET $version= "2.11Enad, 901101"
;--------------------------------------------
; Set these variables to fit your needs
;--------------------------------------------
SET $dir = "NComm:host/" ;Directory for misc. files
;base of all other
SET $menudir = $dir"menus/" ;menus here
SET $bulldir = $dir"bulletins/" ;bulletins here
SET $msgsdir = $dir"msgs/" ;messages here
SET $userdir = $dir"Users/" ;heres the users
SET $userqst = $dir"UserQst/" ;answers to questionare
SET $uldir = $dir"files/" ;Upload directory
SET $dldir = $dir"files/" ;Download directory
SET $hold = $dir"hold/" ;Hold directory
SET $apack = "c:LHARC a " ;packing command
SET $alist = "c:LHARC l " ;listing command
SET $aextract ="c:LHarc x " ;extract command
SET $arch = ".lzh" ;archive extension
SET $holdzoo = $dir"files/HOLD"$arch ;Hold file
SET $tmp = $dir"files/NHS.tmp" ;Temporary file
SET $UlDldir = $dir"fileCredit/" ;Up & Downloaded files
SET $sysop = $dir"Sysop/" ;Sysop directory
SET $cosysop = $dir"CoSysop/" ;coSysop directory
SET $sysname = "Boringtown BBS" ;Name of system
SET $list = "C:list" ;Directory lister
SET $MaxBaud = "2400" ;Modems Maximum Baud
SET $doscomm = $dir"Ckomm/" ;dos commands for remote
SET $hostMNPARQ = "FALSE" ;set to false if not using
;a MNP or ARQ modem
;All files in hold directory will be deleted at initialization!!!
;-------------------- M A I N P R O G R A M -----------------------;
message "\f" ;Clear screen
main: clrstack
gosub init ;Initialize various stuff
gosub connect ;Wait for RING and answer the phone
timeout 300 goto bibi ;must have it here i think..
when "\r\nNO CARRIER\r\n" goto NoCarrier
gosub prelog ;Show opening picture
gosub login ;Get name & password
timeout 300 goto bibi ;must have it here i think..
IF exists $sysop$name THEN goto SysopLogin
IF !EXISTS $cosysop$name then goto user
SysopLogin:
SET $sysacc = "TRUE"
IF !EXISTS $cosysop$name then goto realsysop
SET $cosys = "TRUE"
IF EXISTS $cosysop$name$pass THEN goto OK
gosub logout
goto main
RealSysop:
IF exists $sysop$name$pass THEN goto OK
send "Wrong!!\n"
write $dir"log" "\n"$date" Wrong SYSOP password: "$pass"\n"
gosub logout
goto main
user: SET $sysacc = "FALSE"
IF !EXISTS $userdir$name THEN goto NTry
IF EXISTS $userdir$name$pass THEN goto OK
send "Wrong!\n"
NTry:
write $dir"log" "\n"$date" "$name" Wrong password: "$pass"\n"
gosub login
IF !EXISTS $userdir$name THEN goto WrngName
IF EXISTS $userdir$name$pass THEN goto OK
WrngName:
send "Wrong!!\n"
write $dir"log" "\n"$date" "$name" Wrong password: "$pass"\n"
gosub logout
goto main
;User has logged in
OK: write $dir"log" "\n"$date" Login: "$name" ("$baud")\n"
send "\n\nYour last logon was:\n"
ascsend $userdir$name$pass
CLI "delete >nil: \""$userdir$name$pass"\""
write $userdir$name$pass $date"\n"
gosub postlog
timeout 2
echo off
send "^[[97x"
input $id "\r"
timeout 300 goto bibi ;must have it here i think..
echo on
send "\nPress [ENTER] to continue..."
input $dummy "\r"
send "\f"
IF !EXISTS $msgsdir$name then goto OK1
Send "\n\nYou have messages waiting.\n"
send "==========================\n\n"
OK1: ascsend $menudir".menu0"
;This is the main loop
loop: gosub MainMenu
send "Are you sure you want to log off (Enter=Y)? "
input $cmd "\r"
IF $cmd == "N" THEN goto loop
send "\n"
gosub logout
goto main
;--------------------- S U B R O U T I N E S ----------------------
;********************************************************
;* Initialize the system
;********************************************************
init: config $dir"host.config"
hangup
converse "OK" "\w\w\w+++\w\w\w\wATZ\n" ;Reset to saved default
converse "OK" "\w\w\w+++\w\w\w\wATX4V1M0\n" ;
converse "OK" "\w\w\wATS7=60\n" ;Wait one full minute for carrier
wait "OK"
SET $sysacc = "FALSE"
SET $cosys = "FALSE"
echo off
dwhens
timeout 0
CLI "delete >nil: "$hold"#?"
write $hold$sysname $sysname"\n Is running on version "$version"\n"
return
;********************************************************
;* Wait for CONNECT
;********************************************************
connect:
dwhens
send " \r"
gosub skip
conn0: SET $Local = "FALSE"
message "\n\n\n"$sysname" [Press '?' for help]\n"
message "Waiting on call...\n"
ConnW: timeout 300 Goto DoExitQ ; just wait for 5 minutes
input $char "" ;Get one character
timeout 90 goto noconnect
IF !$char == "?" THEN goto conn1
message "\n\nSpace = Local logon (turn the modem off first!)\n"
goto conn0
conn1: IF $char == " " THEN goto Local
IF $char == "R" Then goto Local2
conn2:
when "CONNECT 1200" goto conn1200
when "CONNECT 2400" goto conn2400
when "CONNECT 4800" goto conn4800
when "CONNECT 9600" goto conn9600
dtenths 7
SET $baud = $MaxBaud
send "\n\w\wAT\w\wA\n"
timeout 90 goto noconnect
wait "NO CARRIER"
NoConnect:
write $dir"log" "\n\n"$date" Login Failed\n\n"
gosub init
goto connect
conn3: dwhens
timeout 300 goto bibi
echo on
gosub skip
return
Local: message "\nStarting local logon..."
SET $baud = "19200"
SET $Local = "TRUE"
goto conn3
Local2: message "\nStarting local/remote logon.."
SET $baud = "19200"
goto conn3
QuitNHS:
config "NComm:NComm.config"
end
conn1200:
SET $baud = "1200"
goto conn3
conn2400:
SET $baud = "2400"
goto conn3
conn4800:
SET $baud = "4800"
goto conn3
conn9600:
SET $baud = "9600"
goto conn3
;**************************************************************************
; Check if another program wants NHS to quit.
; In that case, a file named NHSQUIT shuld be placed in the RAM:C directory
; you should also let the startup-sequence place DELETE there
; The place of the file may be changed.
; The Script tells it is quiting by removing this file
;***************************************************************************
DoExitQ:
IF !EXISTS "RAM:C/NHSQUIT" THEN goto ConnW
Hangup ; shouldn't be neccesary
CLI "RAM:C/DELETE RAM:C/NHSQUIT"
QUIT
END
;********************************************************
;* Show "prelog", i.e. the picture to be shown before
;* login.
;********************************************************
prelog: send "\f"$sysname" ("$baud") up on "$date"\n"
send $NComm" / NComm Host System (NHS) v"$version"\n"
send "Copyright (c) 1989 Daniel Bloch (-> ver 1.3)\n"
send "Copyright (c) 1990 Nils-Arne Dahlberg\n\n"
ascsend $dir"prelog"
return
;********************************************************
;* Show "postlog", i.e. the picture to be shown after
;* login.
;********************************************************
postlog:
send "\n\n"
ascsend $dir"postlog"
; CLI "cookie"
return
;********************************************************
;* Read user name and password into the variables
;* $name and $pass.
;********************************************************
Login: echo on
timeout 120 goto LogSleep
send "\n\nYour name: "
input $name "\r"
IF $name == "new" then goto NewUser
NilPass:
send "\nYour password: "
echo off
input $pass "\r"
echo on
IF $pass == "" then goto NilPass
timeout 300 goto bibi
send "\n"
return
LogSleep:
send "\n\nLogon terminated after 2 minutes\n"
gosub logout
goto main
NewUser:
ascsend $dir"newuser"
Newname:
send "\n\nYour name: "
input $name "\r"
send "\n"$name" Correct? (y/N)"
input $ok "\r"
IF !$ok == "y" then goto Newname
NewPassIn:
send "\nYour password: "
echo off
input $pass "\r"
echo on
send "Once more... : "
echo off
input $pass1 "\r"
echo on
if $pass == $pass1 then goto NewPassOK
send "\nSorry, line noice, enter password again\n"
goto NewPassIn
NewPassOk:
write $userdir$name $date"\n"
write $userdir$name$pass $date"\n"
write $dir"User" $name" (Ordinary user)\n"
write $dir"log" $date"\n\n New User: "$name"\n"
timeout 300 goto bibi
send "\n"
; Here is a questionare, its simple, but it should work...
;just add and delete questions as apropriate
send "\nBefore you enter the BBS, I would like you to answer\n"
send "the following questions:\n"
write $userqst$name $name
send "\nAddress (2/4): "
input $tmp "\r"
write $userqst$name $tmp"\n"
send "\nAddress (3/4): "
input $tmp "\r"
write $userqst$name $tmp"\n"
send "\nAddress (4/4): "
input $tmp "\r"
write $userqst$name $tmp"\n"
send "\nComputer: "
input $tmp "\r"
write $userqst$name $tmp"\n"
send "\n\nThank you, I hope you enjoy it here!\n\n"
return
;********************************************************
;Skip junk from the modem
;********************************************************
skip: timeout 3 goto SkipOK
more: wait ""
goto more
SkipOK: timeout 300 goto bibi
return
;********************************************************
;* Log out
;********************************************************
logout: ;CLI "fortune"
ascsend $dir"Logout"
hangup
write $dir"log" $date" Logout: "$name"\n"
CLI "delete >nil: "$holdzoo" "$hold"#?"
write $hold$sysname $sysname"\n Runs with version "$version"\n"
return
;********************************************************
;* User sleeps
;********************************************************
bibi: send "\n\nGood night!"
write $dir"log" $date" Sleep disconect\n"
gosub logout
goto main
;********************************************************
;Main menu
;********************************************************
MainMenu:
send "\nCommand (? or ! for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN ascsend $menudir".menu0"
IF $cmd == "!" THEN ascsend $menudir"menu0"
IF $cmd == "G" THEN return
IF $cmd == "F" THEN gosub FileMenu
IF $cmd == "B" THEN gosub BullMenu
IF $cmd == "O" THEN gosub page
IF $cmd == "S" THEN gosub sysop
IF $cmd == "C" THEN gosub Comment
IF $cmd == "M" THEN gosub Messages
IF $cmd == "E" THEN gosub LetterMenu
IF $cmd == "P" THEN gosub ChangePasswd
IF $cmd == "L" THEN gosub ListUsers
IF $cmd == "V" THEN send "Version:"$version"\n"
goto MainMenu
;********************************************************
;Chat with SYSOP
;********************************************************
page: send "\Calling SYSOP...\n"
send "(press Ctrl-Z to end the conversation)\n"
beep
dtenths 3
beep
dtenths 3
beep
write $dir"log" $date" Paged operator\n"
when "^Z" goto EndChat
chat: input $dummy "\r"
send "\n"
goto chat
EndChat:
dlwhen
send "\n"
return
;*********************************************
;Change Password
;*********************************************
ChangePasswd:
send "\n\nWhat do you want to change your password to? (Enter to cancel) "
echo off
input $psw1 "\r"
if $psw1 == "" then goto NoCHP
echo on
send "\nOne time more, thanks "
echo off
input $psw2 "\r"
echo on
IF !$psw1 == $psw2 THEN goto ChPErr
CLI "rename >nil: \""$userdir$name$pass"\" to \""$userdir$name$psw1"\""
IF $CoSys == "TRUE" then goto CoSysopChpsw
IF $SysAcc == "TRUE" then goto SysopChpsw
ChaPsw: send "\n\nPassword changed \n\n"
write $dir"log" $date" Changed passwd from "$pass" to "$psw1"\n"
SET $pass = $psw1
return
NoCHP:
echo on
return
ChPErr:
send "\nSomething wrong there, try again.\n"
goto ChangePasswd
CoSysopChpsw:
CLI "rename >nil: \""$Cosysop$name$pass"\" to \""$Cosysop$name$psw1"\""
goto ChaPsw
SysopChpsw:
CLI "rename >nil: \""$Sysop$name$pass"\" to \""$Sysop$name$psw1"\""
goto ChaPsw
;*******************************************************
;List users who have logged in
;*******************************************************
ListUsers:
send "\nUsers up to "$date"\n"
ascsend $dir"user"
write $dir"log" $date" Listed Users\n"
return
;********************************************************
;File menu
;********************************************************
FileMenu:
send "\nFile command (? or ! for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN ascsend $menudir".menu1"
IF $cmd == "!" THEN ascsend $menudir"menu1"
IF $cmd == "" THEN return
IF $cmd == "Q" THEN return
IF $cmd == "L" THEN gosub ListFiles
IF $cmd == "D" THEN gosub Download
IF $cmd == "U" THEN gosub Upload
IF $cmd == "V" THEN gosub ViewZOO
IF $cmd == "S" THEN gosub QListFiles
IF $cmd == "EXT" THEN gosub ExtractZOO
IF $cmd == "ADD" THEN gosub AddFile
IF $cmd == "DEL" THEN gosub Remove
IF $cmd == "DIR" THEN gosub Show
IF $cmd == "GET" THEN gosub GetHold
goto FileMenu
;********************************************************
;List files in download directory
;********************************************************
ListFiles:
send "\n"
CLI $list" "$dldir
return
;********************************************************
;List files in download directory quick
;********************************************************
QListFiles:
send "\n"
CLI "C:ls "$dldir
return
;********************************************************
;Download file
;********************************************************
Download:
IF EXISTS $UlDldir$name"UL" then goto DownlOK1
send "\nNo files up, no files down....\n"
return
DownlOK1:
send "\nFilename: "
input $file "\r"
send "\n"
IF $file == "" THEN return
IF exists $dldir$file THEN goto DownlOK
send "The file '"$file"' does not exist!\n"
return
DownlOK:
send "Choose protocol (B,G,X,Y,Z)\n"
send "B=Ymodem Batch, G=Ymodem-G :"
input $proto "\r"
send "\n"
IF $proto == "" THEN return
IF $proto == "X" THEN goto XDownload
IF $proto == "Y" THEN goto YDownload
IF $proto == "Z" THEN goto ZDownload
IF $proto == "B" THEN goto BDownload
IF $proto == "G" THEN goto GDownload
send "Illegal protocol!\n"
goto DownlOK
XDownload:
send "Waiting...\n"
upload $dldir$file,x
write $dir"log" $date" Downloaded "$file" (Xmodem)\n"
write $UlDldir$name"DL" $file"\n"
return
YDownload:
send "Waiting...\n"
upload $dldir$file,y
write $dir"log" $date" Downloaded "$file" (Ymodem)\n"
write $UlDldir$name"DL" $file"\n"
return
ZDownload:
send "Waiting...\n"
upload $dldir$file,z
write $dir"log" $date" Downloaded "$file" (Zmodem)\n"
write $UlDldir$name"DL" $file"\n"
return
BDownload:
send "Waiting...\n"
upload $dldir$file,b
write $dir"log" $date" Downloaded "$file" (Ymodem-Batch)\n"
write $UlDldir$name"DL" $file"\n"
return
GDownload:
IF $hostMNPARQ == "FALSE" then goto NoGDL
send "Waiting...\n"
upload $dldir$file,g
write $dir"log" $date" Downloaded "$file" (Ymodem-G)\n"
write $UlDldir$name"DL" $file"\n"
return
NoGDL:
send "\n\nThis BBS can't handle Ymodem-G, try another protocol\n"
goto DownlOk
;********************************************************
;Upload file
;********************************************************
Upload:
send "\nFilename: "
input $file "\r"
send "\n"
IF $file == "" THEN return
IF EXISTS $UlDldir$name"ULok" then goto ULOK
send "\n\nSorry, you have no upload-credit..\n"
return
IF !EXISTS $uldir$file THEN goto UploadOK
send "The file '"$file"' allready exists!\n"
return
UploadOK:
send "Describe the file: "
input $desc "\r"
send "\n"
GetProto:
send "Choose protocol (B,G,X,Y,Z)\n"
send "B=Ymodem Batch, G=Ymodem-G: "
input $proto "\r"
send "\n"
IF $proto == "" THEN return
IF $proto == "X" THEN goto XUpload
IF $proto == "Y" THEN goto YUpload
IF $proto == "Z" THEN goto ZUpload
IF $proto == "B" THEN goto BUpload
IF $proto == "G" THEN goto GUpload
send "Illegal protocol!\n"
goto GetProto
XUpload:
send "Waiting...\n"
download $uldir$file,x
write $dir"log" $date" Uploaded "$file" (Xmodem)\n"
IF !$desc == "" THEN CLI "Filenote file "$uldir$file" comment \""$desc"\""
IF EXISTS $uldir$file THEN write $UlDldir$name"UL" $file"\n"
return
YUpload:
send "Waiting...\n"
download $uldir$file,y
write $dir"log" $date" Uploaded "$file" (Ymodem)\n"
IF !$desc == "" THEN CLI "Filenote file "$uldir$file" comment \""$desc"\""
IF EXISTS $uldir$file THEN write $UlDldir$name"UL" $file"\n"
return
ZUpload:
send "Waiting...\n"
download $uldir$file,z
write $dir"log" $date" Uploaded "$file" (Zmodem)\n"
IF !$desc == "" THEN CLI "Filenote file "$uldir$file" comment \""$desc"\""
IF EXISTS $uldir$file THEN write $UlDldir$name"UL" $file"\n"
return
BUpload:
send "Waiting...\n"
download $uldir$file,b
write $dir"log" $date" Uploaded "$file" (Ymodem-Batch)\n"
IF !$desc == "" THEN CLI "Filenote file "$uldir$file" comment \""$desc"\""
IF EXISTS $uldir$file THEN write $UlDldir$name"UL" $file"\n"
return
GUpload:
IF $hostMNPARQ == "FALSE" then goto NoGUL
send "Waiting...\n"
download $uldir$file,g
write $dir"log" $date" Uploaded "$file" (Ymodem-g)\n"
IF !$desc == "" THEN CLI "Filenote file "$uldir$file" comment \""$desc"\""
IF EXISTS $uldir$file THEN write $UlDldir$name"UL" $file"\n"
return
NoGUL:
send "\n\nThis BBS can't handle Ymodem-G, try another protocol\n"
goto GetProto
;********************************************************
;Bulletin menu
;********************************************************
BullMenu:
ascsend $menudir".menu2"
bull: send "\nBulletin number (? or ! for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN goto BullMenu
IF $cmd == "!" THEN goto BullMe
IF $cmd == "" THEN return
IF $cmd == "Q" THEN return
IF exists $bulldir"bull"$cmd THEN goto ShowBull
send "Illegal bulletin-number!\n"
goto bull
BullMe:
ascsend $menudir"menu2"
goto bull
ShowBull:
send "\n"
ascsend $bulldir"bull"$cmd
write $dir"log" $date" Read bulletin #"$cmd"\n"
goto bull
;********************************************************
;Sysop menu
;********************************************************
SysopMenu:
ascsend $menudir"menu3"
Sysop:
IF $sysacc == "TRUE" THEN goto SysOK
send "Nope, you're not allowed!\n"
write $dir"log" $date" Attempted restricted command\n"
return
SysOK: send "\nSysop Command (? for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN goto SysopMenu
IF $cmd == "Q" THEN return
IF $cmd == "" THEN return
IF $cmd == "L" THEN goto ListLog
IF $cmd == "R" THEN goto Priv
IF $cmd == "D" THEN goto DeleteLog
IF $cmd == "C" THEN goto DeleteComm
IF $cmd == "B" THEN goto RemoteBackup
IF $cmd == "S" THEN goto StartScript
;********************************************************
;Execute DOS command
;********************************************************
write $dir"log" $date" Executed DOS command: "$cmd"\n"
send "\n Commands that can be executed from remote are:\n"
CLI "C:ls "$doscomm
if $local == "FALSE" then goto NoLocalDos
CLI $cmd
goto sysok
NoLocalDos:
CLI $doscomm$cmd
goto sysok
NoDos:
send "\n\nOnly available in local mode, sorry!!\n\n"
goto sysok
goto sysok
;********************************************************
;Delete log file
;********************************************************
DeleteLog:
if $local == "FALSE" then goto NoDos
IF $cosys == "TRUE" then goto sysok
send "\nSäker (Enter=N)? "
input $cmd "\r"
send "\n"
IF !$cmd == "Y" THEN goto sysok
CLI "delete "$dir"log"
write $dir"log" $date" Started new log\n"
goto sysok
;********************************************************
;Delete private messages
;********************************************************
DeleteComm:
if $local == "FALSE" then goto NoDos
IF $cosys == "TRUE" then goto sysok
send "\nDelete all private messages (Enter=N)? "
input $cmd "\r"
send "\n"
IF !$cmd == "Y" then goto sysok
CLI "delete >nil: "$msgsdir"Comments"
write $dir"log" $date" Private messages deleted\n"
goto sysok
;********************************************************
;List log file
;********************************************************
ListLog:
send "\n"
ascsend $dir"log"
write $dir"log" $date" Listed Log\n"
goto sysok
;********************************************************
;Remote Backup
;********************************************************
RemoteBackup:
send "\nRemote Backup started.\n"
CLI "run >nil: <nil: copy ncomm:host to df1:host all clone"
write $dir"log" $date" Started Remote Backup\n"
goto sysok
;********************************************************
;Start a script
;********************************************************
StartScript:
Send "\n\nThis is a Point of No Return!!!\n\n"
send "When the script is started there is _NO WAY BACK_\n\n"
Send "Continue? (Enter=N)"
input $Cont "\r"
If $cont == "Y" THEN GOTO StartS1
goto sysok
StartS1:
CHAIN $dir"A.Script"
;********************************************************
;Comment to sysop
;********************************************************
Comment:
send "\n\nSubject: "
input $subject "\r"
IF $subject == "" then return
SET $to = "Sysop"
SET $mfile = "Comments"
SET $mtype = "Comment to sysop"
goto Writemess
;********************************************************
;Messages menu
;********************************************************
Messages:
ascsend $menudir".menu5"
Mess1: send "\nMessage command (? or ! for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN goto Messages
IF $cmd == "!" THEN goto Mess2
IF $cmd == "" THEN return
IF $cmd == "Q" THEN return
IF $cmd == "R" THEN goto Mess3
IF $cmd == "W" THEN goto Mess3
GOTO Mess1
Mess3:
send "\nArea number (? or ! for menu): "
input $area "\r"
IF $area == "?" THEN goto Mess3a
IF $area == "!" THEN goto Mess3b
send "\n"
IF exists $msgsdir"messages"$area THEN goto Mess4
send "Illegal Area-number!\n"
goto Mess1
Mess3a:
ascsend $menudir".menu5"
goto Mess3
Mess3b:
ascsend $menudir"menu5"
goto Mess3
Mess2: ascsend $menudir"menu5"
goto Mess1
Mess4: IF $cmd =="R" THEN goto Read
gosub Enter
goto Mess1
;********************************************************
;Enter message
;********************************************************
Enter:
send "\nTo (Enter=ALL): "
input $to "\r"
IF $to == "" then SET $to = "ALL"
send "\nSubject: "
input $subject "\r"
IF $subject == "" then return
SET $mfile = "messages"$area
SET $mtype = "Area"$area
goto Writemess
;********************************************************
;Read public messages
;********************************************************
Read:
ascsend $msgsdir"messages"$area
write $dir"log" $date" Read message in area "$area"\n"
goto Mess1
;********************************************************
;Read private messages
;********************************************************
Priv: IF !EXISTS $msgsdir"comments" then goto sysok
ascsend $msgsdir"comments"
write $dir"log" $date" Read private messages.\n"
goto sysok
;********************************************************
;Handle NO CARRIER
;********************************************************
NoCarrier:
write $dir"log" $date" CARRIER LOST\n"
gosub logout
goto main
;********************************************************
;View ZOO file
;********************************************************
ViewZOO:
send "\nGive the name of the "$arch" file: "
input $file "\r"
send "\n"
IF $file == "" then return
IF exists $dldir$file then goto ViewOK
IF exists $dldir$file$arch then goto ViewOK
send "The file does not exist!\n"
return
ViewOK: write $dir"log" $date" "$arch" view of "$file"\n"
CLI $alist$dldir$file
return
;********************************************************
;Extract ZOO file
;********************************************************
ExtractZOO:
IF EXISTS $UlDldir$name"UL" then goto ExtraZ1
send "\nNo files up, no files down....\n"
return
ExtraZ1:
send "\nGive the name of the "$arch" file: "
input $file "\r"
send "\n"
IF $file == "" then return
IF exists $dldir$file then goto ExtOK
IF exists $dldir$file$arch then goto ExtOK
send "The file does not exist!\n"
return
ExtOK: send "\nGive the name of the file(s) to extract [Enter=all]: "
input $files "\r"
write $dir"log" $date" Extracted "$file" "$files"\n"
send "\n"
CLI "delete >nil: "$tmp
write $tmp "CD "$hold"\n"
write $tmp $aextract$dldir$file" "$files"\n"
CLI "execute "$tmp
return
;********************************************************
;Add file to HOLD
;********************************************************
AddFile:
IF EXISTS $UlDldir$name"UL" then goto AddF1
send "\nNo files up, no files down....\n"
return
AddF1:
send "\nFilename: "
input $file "\r"
send "\n"
IF $file == "" then return
IF exists $dldir$file then goto AddOK
send "The file '"$file"' does not exist!\n"
return
AddOK: CLI "COPY "$dldir$file" "$hold
write $dir"log" $date" Added "$file"\n"
return
;********************************************************
;Delete file(s) from HOLD
;********************************************************
Remove: send "\nFilename: "
input $file "\r"
send "\n"
IF $file == "" then return
write $dir"log" $date" Deleted "$file"\n"
CLI "delete \""$hold$file"\""
return
;********************************************************
;List files in HOLD directory
;********************************************************
Show:
send "\n"
CLI $list" "$hold
return
;********************************************************
;Download files in HOLD directory
;********************************************************
GetHold:
send "Wait while I pack the files...\n"
CLI "delete >nil: "$holdzoo
CLI $apack$holdzoo" "$hold"*"
GetPr:
send "Choose protocol (B,G,X,Y,Z)\n"
send "B=Ymodem Batch, G=Ymodem-G: "
input $proto "\r"
send "\n"
IF !$proto == "" THEN goto Get1
CLI "delete >nil: "$holdzoo
return
Get1: IF $proto == "X" THEN goto XGet
IF $proto == "Y" THEN goto YGet
IF $proto == "Z" THEN goto ZGet
IF $proto == "B" THEN goto BGet
IF $proto == "G" THEN goto GGet
send "Illegal protocol!\n"
goto GetPr
XGet:
send "Waiting...\n"
upload $holdzoo,x
write $dir"log" $date" Downloaded HOLD"$arch" (Xmodem)\n"
write $UlDldir$name"DL" "HOLD"$arch":\n"
CLI "list >>\""$UlDldir$name"DL\" "$hold" quick nohead"
CLI "delete >nil: "$holdzoo
return
YGet:
send "Waiting...\n"
upload $holdzoo,y
write $dir"log" $date" Downloaded HOLD"$arch" (Ymodem)\n"
write $UlDldir$name"DL" "HOLD"$arch":\n"
CLI "list >>\""$UlDldir$name"DL\" "$hold" quick nohead"
CLI "delete >nil: "$holdzoo
return
ZGet:
send "Waiting...\n"
upload $holdzoo,z
write $dir"log" $date" Downloaded HOLD"$arch" (Zmodem)\n"
write $UlDldir$name"DL" "HOLD"$arch":\n"
CLI "list >>\""$UlDldir$name"DL\" "$hold" quick nohead"
CLI "delete >nil: "$holdzoo
return
BGet:
send "Waiting...\n"
upload $holdzoo,b
write $dir"log" $date" Downloaded HOLD"$arch" (Ymodem-Batch)\n"
write $UlDldir$name"DL" "HOLD"$arch":\n"
CLI "list >>\""$UlDldir$name"DL\" "$hold" quick nohead"
CLI "delete >nil: "$holdzoo
return
GGet:
IF $hostMNPARQ == "FALSE" then goto NoGGet
send "Waiting...\n"
upload $holdzoo,z
write $dir"log" $date" Downloaded HOLD"$arch" (Ymodem-G)\n"
write $UlDldir$name"DL" "HOLD"$arch":\n"
CLI "list >>\""$UlDldir$name"DL\" "$hold" quick nohead"
CLI "delete >nil: "$holdzoo
return
NoGGet:
send "\n\nThis BBS can't handle Ymodem-G, try another protocol\n"
goto GetPr
;********************************************************
;Letter menu, private mail
:********************************************************
LetterMenu:
send "\nLetter command (? or ! for menu): "
input $cmd "\r"
send "\n"
IF $cmd == "?" THEN ascsend $menudir".menu4"
IF $cmd == "!" THEN ascsend $menudir"menu4"
IF $cmd == "" THEN return
IF $cmd == "Q" THEN return
IF $cmd == "R" THEN gosub ReadLetter
IF $cmd == "W" THEN gosub WriteLetter
IF $cmd == "E" THEN gosub DeleteLetter
IF $cmd == "G" THEN gosub GrabMail
goto LetterMenu
;********************************************************
;Enter message
;********************************************************
WriteLetter:
send "\nTo: (enter to abort) "
input $to "\r"
IF $to == "" then return
IF EXISTS $userdir$to THEN goto WLCont
send "There is no user with the name "$to
goto WriteLetter
WLCont: send "\nSubject: (enter to abort) "
input $subject "\r"
IF $subject == "" then return
SET $mtype = "Private"
SET $mfile = $to
goto writemess
;********************************************************
;Read private messages
;********************************************************
ReadLetter:
IF !EXISTS $msgsdir$name then goto NoLetter
ascsend $msgsdir$name
write $dir"log" $date" Read private letters \n"
return
NoLetter:
send "No private mail to "$name"\n"
return
;********************************************************
;Delete private messages
;********************************************************
DeleteLetter:
send "\nErase all private mail? (Enter=N) "
input $cmd "\r"
send "\n"
IF !$cmd == "Y" then return
CLI "delete >nil: \""$msgsdir$name"\""
write $dir"log" $date" Private messages deleted\n"
return
;********************************************************
;Grab all mail
;********************************************************
GrabMail:
CLI "copy >nil: \""$msgsdir$name"\" to \""$hold"\""
send "\n\nAdd messageareas (enter=Y) ?"
input $cmd "\r"
send "\n\n"
if !$cmd == "N" then CLI "copy >nil: \""$msgsdir"messages#?\" to \""$hold"\""
send "\n\nAdd bulletins (enter=Y) ?"
input $cmd "\r"
send "\n\n"
if !$cmd == "N" then CLI "copy >nil: \""$bulldir"bull#?\" to \""$hold"\""
write $dir"log" $date" Fetched mail\n"
goto gethold
;********************************************************
;Enter message
; $to = to who
; $mfile = to wich file
; $mtype = type of message
;********************************************************
WriteMess:
CLI "c:delete >NIL: RAM:__NHSX__TMP__"
cli "c:Copy >nil: \""$msgsdir$mfile"\" to RAM:__NHSX__TMP__"
SET $header = "\n\nFrom: "$name"\n"
SET $header = $header"To: "$to"\nSubject: "$subject"\n"
SET $header = $header"Date: "$date"\n"
SET $header = $header"-------------------------------\n"
write "RAM:__NHSX__TMP__" $header
send $header
send "[Write in your message below; "
send "end with Ctrl-Z on a blank line]\n\n"
when "^Z" goto endWL
WLent: input $line "\r"
send "\n"
write "RAM:__NHSX__TMP__" $line"\n"
goto WLent
EndWL: dlwhen
cli "c:Copy >nil: RAM:__NHSX__TMP__ to \""$msgsdir$mfile"\""
send "\nMessage saved!^G\n"
write $dir"log" $date" Entered "$mtype" message\n"
return